package org.jeecg.modules.xmss.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.xmss.entity.XmssIdeaType;
import org.jeecg.modules.xmss.entity.XmssTowns;
import org.jeecg.modules.xmss.service.IXmssIdeaTypeService;
import org.jeecg.modules.xmss.service.IXmssTownsService;
import org.jeecg.modules.xmss.vo.XmssTownsPage;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @Description: 乡镇信息表-公众号标识
* @Author: jeecg-boot
* @Date:   2020-09-18
* @Version: V1.0
*/
@Api(tags="意见类型")
@RestController
@RequestMapping("/xmss/xmssIdeaType")
@Slf4j
public class XmssIdeaTpyeController {

    @Autowired
    IXmssIdeaTypeService iXmssIdeaTypeService;
   /**
    * 分页列表查询
    *
    * @param
    * @param pageNo
    * @param pageSize
    * @param req
    * @return
    */
   @AutoLog(value = "意见类型")
   @ApiOperation(value="意见类型", notes="意见类型-分页列表查询jqk")
   @GetMapping(value = "/list")
   public Result<?> queryPageList(XmssIdeaType xmssIdeaType,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                  HttpServletRequest req) {
       QueryWrapper<XmssIdeaType> queryWrapper = QueryGenerator.initQueryWrapper(xmssIdeaType, req.getParameterMap());
       Page<XmssIdeaType> page = new Page<XmssIdeaType>(pageNo, pageSize);
       IPage<XmssIdeaType> pageList = iXmssIdeaTypeService.page(page, queryWrapper);
       return Result.OK(pageList);
   }



}
